<template>
	<view>
		<view class="why">
			<view>请选择投诉原因</view>
		</view>
		<view class="list">
			<view class="bot1 bot2 bot3" v-for="(item, index) in list" :key="index" @click="tousu(item)">
				<view>{{item}}</view>
				<image src="../../static/image/fanhui_21.png" class="fanhui"></image>
			</view>
			<!-- <view class="bot1 bot2 bot3">
				<view>恶意传播广告</view>
				<image src="../../static/image/fanhui_21.png" class="fanhui"></image>
			</view>
			<view class="bot1 bot2">
				<view>通过不正当手段获取他人或公司机密</view>
				<image src="../../static/image/fanhui_21.png" class="fanhui"></image>
			</view> -->
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:['发布色情、广告对我造成骚扰','恶意传播广告','通过不正当手段获取他人或公司机密']
			}
		},
		onShow() {
			this.$msgchat.initwork();
		},
		onLoad(options){
			this.group_id = options.group_id;
		},
		methods: {
			//投诉
			tousu(item){
				var obj = {
					token: uni.getStorageSync('token'),
					friend_id:this.group_id,
					type:2,
					content:item,
				}
				// console.log(obj);return false;
				this.$common.requests('/api/Complaint/addcomplaint', obj).then(res => {
					console.log(res)
					if(res.data.code==1){
						this.$api.msg(res.data.msg);
						uni.navigateTo({
							url:'../groupDetails/groupDetails?group_id='+this.group_id
						})
						return;
					}else{
						this.$api.msg(res.data.msg);
						return;
					}
					
				})
			}
		}
	}
</script>

<style>
	page {
		width: 100vw;
		background: #F5F4F9;
	}

	.why {
		padding: 30upx;
	}

	.list {
		background: #FFF;
		padding: 0 30upx;
		letter-spacing: 3upx;
		border-top: 1px solid #E8E8E8;
		border-bottom: 1px solid #E8E8E8;
	}

	.fanhui {
		width: 20upx;
		height: 30upx;
	}

	.bot1 {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 35upx 0;
	}

	.bot3 {
		border-bottom: 1px solid #E8E8E8;
	}
</style>
